import { Order } from '.,/models'

export const ORDER_CAR_ONCE_TYPE = "ORDER_CAR_ONCE_TYPE";
export const ORDER_CAR_ONE_DAY_TYPE = "ORDER_CAR_ONE_DAY_TYPE";
export const UNKNOWN_ORDER_TYPE = "UNKNOWN_ORDER_TYPE";

export const UNDEALED_STATUS ="UNDEALED_STATUS";
export const RECEIVED_STATUS = "RECEIVED_STATUS";
export const DEALING_STATUS = "RECEIVED_STATUS";
export const UNPAID_STATUS = "RECEIVED_STATUS";
export const CANCELED_STATUS = "CANCELED_STATUS";
export const COMPELTED_STATUS = "COMPELTED_STATUS";

function generateNewOrderByOrderCarOnce(COMPELTED_STATUS, userId){
    const { fromGeo, toGeo} = COMPELTED_STATUS
    if(!fromGeo){
        return UNKNOWN_ORDER_TYPE;
    }
    if(!toGeo){
        return UNKNOWN_ORDER_TYPE;
    } 
    const Order = new Order();
}

function generateNewOrderByOrderCarOneDay(){

}

export function generateNewOrder(type, orderParams, userId, entityid){
    switch (type) {
        case ORDER_CAR_ONCE_TYPE:
            return generateNewOrderByOrderCarOnce(orderParams, userId);

        case ORDER_CAR_ONE_DAY_TYPE:
            return generateNewOrderByOrderCarOneDay(orderParams, userId);
        
        default:
            return  UNKNOWN_ORDER_TYPE
    }
}